<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <%@ include file="../../common/jsp/include.jsp"%>
	<style type="text/css">
		 html, html body
	    {
	        padding:0;border:0;margin:0;
	        width:100%;height:100%;overflow:hidden;
	        font-family:Verdana;
	        font-size:12px;    
	        line-height:22px;
	    }
	     .header
	    {
	        background:url(miniui/base/header.gif) repeat-x 0 -1px;
	    }
 
		</style>
  </head>
  
  <body >
    <div id="layout1" class="mini-layout" style="width: 100%;height: 100%" >
			<div class="header" region="north" height="107" showSplit="false" showHeader="false" style=""  >
		        <h1 style="margin:0;padding:15px;cursor:default;font-family:Verdana;">SoftWare</h1>
		        <div style="position:absolute;top:18px;right:10px;">
		            <a class="mini-button mini-button-iconTop" iconCls="icon-add" onclick="onClick" plain="true">Shortcut</a>    
		            <a class="mini-button mini-button-iconTop" iconCls="icon-edit" onclick="onClick"  plain="true" >Header</a>        
		            <a class="mini-button mini-button-iconTop" iconCls="icon-date" onclick="onClick"  plain="true" >Message</a>        
		            <a class="mini-button mini-button-iconTop" iconCls="icon-edit" onclick="onClick"  plain="true" >Setting</a>        
		            <a class="mini-button mini-button-iconTop" iconCls="icon-close" onclick="onClick"  plain="true" >Close</a>        
		        </div>
		        <br />
                <%--JSP 方式--%>
		        <ul id="menu1" class="mini-menubar" style="width:100%;" url="<%=basePath%>/common/jsp/menuData.jsp"  onitemclick="onItemClick"
			        textField="name" idField="id" parentField="pid" >
	        	</ul>
                <%--封装的Result--%>
                <%--<ul id="menu1" class="mini-menubar" style="width:100%;" url="<%=basePath%>/base/model/dataGrid.do"  onitemclick="onItemClick"
			        textField="text" idField="id" parentField="pid" >
	        	</ul>--%>
		    </div>
			
			<div title="south" region="south" showSplit="false" showHeader="false" height="30" >
		        <div style="line-height:28px;text-align:center;cursor:default">Copyright © On Hai Pujia Software Co., Ltd. All rights reserved. </div>
		   </div>
		   <div title="center" region="center" bodyStyle="overflow:hidden;">

		        <!--Tabs-->
		
		        <div id="mainTabs" class="mini-tabs bg-toolbar" activeIndex="0" style="width:100%;height:100%;" bodyStyle="border:0;background:white;">        
		            <div title="Header" url="<%=basePath%>/base/model/index2.do" >
		            </div>
		        </div>        
		
		    </div>
			<div title="west" region="west" width="200" expanded="false" >

		    </div>

		</div>
		<script type="text/javascript">
		//alert(1);
			//mini.parse();
			//mini.collapseRegion("west");
			//alert(mini.getRegion("west"));
			
			 /*
			 mini.parse();
						  alert(2);
						 mini.collapseRegion("west");
						 alert(3);*/
			mini.parse();

            var layout = mini.get("layout1");
            layout.collapseRegion("west");
	
	        function showTab(node) {
				var url = node.url;
				if(url == null) {
					return;
				}
		        
	            var tabs = mini.get("mainTabs");
	
	            var id = "tab$" + node.id;
	            var tab = tabs.getTab(id);
	            if (!tab) {
	                tab = {};
	                tab.name = id;
	                tab.title = node.text;
	                tab.showCloseButton = true;
	
	                //tab.url = mini_JSPath + "../docs/api/" + node.id + ".html";
	                //tab.url = "../docs/api/" + node.id + ".html";
	                tab.url = baseUrl+url;
	                tabs.addTab(tab);
	            }
	            tabs.activeTab(tab);
	        }
	        function onItemClick(e) {        
	            var item = e.item;
	            var isLeaf = e.isLeaf;
	            if (isLeaf) {
	                showTab(item);
	            }            
	        }
		</script>
  </body>
</html>
